<template>
	<view class="main">
		<navbar :config="config" backColor="#000000"></navbar>
		<view class="image">
			<image :src="imgUrl+'/head-on.png'" mode=""></image>
		</view>
		<view class="u-bold u-font32 title">惠选中亿新消费时代</view>
		<view class="content ql-editor-box" v-html="content"></view>
	</view>
</template>

<script>
	import {
		myInfo
	} from "@/api/login.js"
	export default {
		data() {
			return {
				config: {
					title: '',
					backgroundColor: [1, "#fff"],
					back: true, //false是tolbar页面 是则不写
					color: '#000',
					//背景颜色;参数一：透明度（0-1）;参数二：背景颜色（array则为线性渐变，string为单色背景）
					statusBarFontColor: '#1A1A1A',
					backIconColor: "#000"
				},
				content: '',
				imgUrl: this.$mConfig.staticUrl,
			}
		},
		onLoad(option) {
			this.getProtocol(option.code);
		},
		methods: {
			getProtocol(code) {
				if (code == 'privacy-agreement') {
					this.config.title = '隐私政策'
				}
				if (code == 'about-us') {
					this.config.title = '关于我们'
				}
				if (code == 'privacy-agreement') {
					this.config.title = '用户隐私协议'
				}
				if (code == 'earnings-explain') {
					this.config.title = '收益说明'
				}
				if (code == 'income_statement') {
					this.config.title = '收益说明'
				}
				this.$http.get(`/protocolConfig/info/${code}`)
					.then(res => {
						if (res.code == 200) {
							this.content = res.data.content
						}
					})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.main {
		.content {
			padding: 0 50rpx;
			color: #707070;
		}

		.image {
			margin: 30rpx 0;
			display: flex;
			justify-content: center;

			image {
				width: 100rpx;
				height: 100rpx;
				border-radius: 50%;
			}
		}

		.title {
			color: #707070;
			text-align: center;
			margin-bottom: 30rpx;
		}
	}
</style>